package com.job.sun.HomeWork0707;

import javax.naming.Name;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-08 17:31:21
 */
public class Student {
    //成员变量
    public String name ;
    public int age;

    //成员方法
    public int add2num(int a,int b){
        return a+b;
    }
    //类变量
    public static int count=0;
    //类方法
    public static void show(){
        System.out.println("我是济大学生");
    }
//-------------------
    //构造方法 统计学生对象的数量
    public Student() {
        count++;
    }

    public Student(String name) {
        this.name = name;
        count++;
    }
    public Student(int age) {
        this.age = age;
    }
    public Student( int age,String name) {
        this.name = name;
        this.age = age;
        count++;
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        count++;
    }
}